package cn.com.zte.ant.task.doc.nj.excel.tools;

import cn.com.zte.ngbc.dao.mybatis.dynamicsql.DynamicContext;
import cn.com.zte.ngbc.dao.mybatis.dynamicsql.node.DynamicSqlSqlNodeHandler;
import cn.com.zte.ngbc.dao.mybatis.dynamicsql.node.SqlNodeHandler;
import cn.com.zte.ngbc.dao.mybatis.dynamicsql.node.StrSqlNodeHandler;
import cn.com.zte.ngbc.dao.mybatis.dynamicsql.node.WhereSqlNodeHandler;
import cn.com.zte.ngbc.frw.model.db.DbType;
import cn.com.zte.ngbc.frw.model.sql.Delete;
import cn.com.zte.ngbc.frw.model.sql.Delete.Method;
import cn.com.zte.ngbc.frw.model.sql.DynamicSelect;
import cn.com.zte.ngbc.frw.model.sql.Insert;
import cn.com.zte.ngbc.frw.model.sql.JdbcType;
import cn.com.zte.ngbc.frw.model.sql.Parameter;
import cn.com.zte.ngbc.frw.model.sql.ParameterMap;
import cn.com.zte.ngbc.frw.model.sql.Procedure;

import cn.com.zte.ngbc.frw.model.sql.Result;
import cn.com.zte.ngbc.frw.model.sql.ResultMap;
import cn.com.zte.ngbc.frw.model.sql.Select;
import cn.com.zte.ngbc.frw.model.sql.Select.CacheType;

import cn.com.zte.ngbc.frw.model.sql.Sql;
import cn.com.zte.ngbc.frw.model.sql.SqlGroup;
import cn.com.zte.ngbc.frw.model.sql.Statement;
import cn.com.zte.ngbc.frw.model.sql.Update;
import cn.com.zte.ngbc.frw.model.sql.dynamic.AndSqlNode;
import cn.com.zte.ngbc.frw.model.sql.dynamic.DynamicSqlSqlNode;
import cn.com.zte.ngbc.frw.model.sql.dynamic.IfSqlNode;
import cn.com.zte.ngbc.frw.model.sql.dynamic.OrSqlNode;
import cn.com.zte.ngbc.frw.model.sql.dynamic.SqlNode;
import cn.com.zte.ngbc.frw.model.sql.dynamic.StrSqlNode;
import cn.com.zte.ngbc.frw.model.sql.dynamic.WhereSqlNode;
import cn.com.zte.ngbc.frw.model.util.ModelFactoryUtil;
import cn.com.zte.ngbc.frw.model.util.XmlConfigManager;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.UnsupportedEncodingException;
import java.util.ArrayList;
import java.util.List;
import org.apache.poi.hssf.usermodel.HSSFCell;
import org.apache.poi.hssf.usermodel.HSSFCellStyle;
import org.apache.poi.hssf.usermodel.HSSFFont;
import org.apache.poi.hssf.usermodel.HSSFRow;
import org.apache.poi.hssf.usermodel.HSSFSheet;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.apache.poi.ss.util.CellRangeAddress;

public class NsqlExcelProcessor2 extends AbstractExcelProcessor<SqlGroup>
{
  public HSSFWorkbook process(List<SqlGroup> models, File fileName)
  {
/*  43 */     HSSFWorkbook book = new HSSFWorkbook();
/*  44 */     String name = fileName.getName().substring(0, fileName.getName().indexOf("."));
/*  45 */     HSSFSheet overView = book.createSheet(name + "服务总览");
/*  46 */     short s = Short.parseShort("1");
/*  47 */     HSSFFont font = book.createFont();
/*  48 */     font.setUnderline(UNDERLINE);
/*  49 */     font.setColor((short)12);
    
/*  51 */     HSSFFont font2 = book.createFont();
/*  52 */     font2.setBoldweight((short)700);
    
/*  54 */     HSSFCellStyle style = book.createCellStyle();
/*  55 */     style.setBorderLeft(s);
/*  56 */     style.setBorderBottom(s);
/*  57 */     style.setBorderRight(s);
/*  58 */     style.setBorderTop(s);
    
/*  60 */     HSSFCellStyle style3 = book.createCellStyle();
/*  61 */     style3.setBorderLeft(s);
/*  62 */     style3.setBorderBottom(s);
/*  63 */     style3.setBorderRight(s);
/*  64 */     style3.setBorderTop(s);
/*  65 */     style3.setFillPattern(this.FILLPATTERN);
/*  66 */     style3.setFillForegroundColor(this.FGC_GREY_25);
    
/*  68 */     HSSFCellStyle style2 = book.createCellStyle();
/*  69 */     style2.setBorderLeft(s);
/*  70 */     style2.setBorderBottom(s);
/*  71 */     style2.setBorderRight(s);
/*  72 */     style2.setBorderTop(s);
/*  73 */     style2.setFont(font);
    
/*  75 */     HSSFRow title = overView.createRow(0);
/*  76 */     HSSFCell t_cell0 = title.createCell(0);
/*  77 */     t_cell0.setCellValue("命名SQL类别");
/*  78 */     t_cell0.setCellStyle(style3);
/*  79 */     HSSFCell t_cell1 = title.createCell(1);
/*  80 */     t_cell1.setCellValue("命名SQL中文名称");
/*  81 */     t_cell1.setCellStyle(style3);
/*  82 */     HSSFCell t_cell2 = title.createCell(2);
/*  83 */     t_cell2.setCellValue("命名SQLID");
/*  84 */     t_cell2.setCellStyle(style3);
/*  85 */     HSSFCell t_cell3 = title.createCell(3);
/*  86 */     t_cell3.setCellValue("命名SQL中文名称");
/*  87 */     t_cell3.setCellStyle(style3);
/*  88 */     HSSFCell t_cell4 = title.createCell(4);
/*  89 */     t_cell4.setCellValue("命名SQLID");
/*  90 */     t_cell4.setCellStyle(style3);
    
/*  92 */     HSSFCellStyle cata = book.createCellStyle();
/*  93 */     cata.setWrapText(true);
/*  94 */     cata.setAlignment((short)2);
/*  95 */     cata.setVerticalAlignment((short)1);
/*  96 */     cata.setFont(font2);
    
/*  98 */     for (SqlGroup group : models) {
/*  99 */       HSSFRow blank = overView.createRow(overView.getLastRowNum() + 1);
/* 100 */       if ((group.getSqls() != null) && (group.getSqls().size() != 0))
      {
/* 102 */         blank.createCell(0);
/* 103 */         blank.createCell(1);
/* 104 */         blank.createCell(2);
/* 105 */         blank.createCell(3);
/* 106 */         blank.createCell(4);
        
/* 108 */         List<Statement> statement1 = group.getSqls().subList(0, group.getSqls().size() / 2 + group.getSqls().size() % 2);
        
/* 110 */         List<Statement> statement2 = null;
/* 111 */         if (group.getSqls().size() > 1) {
/* 112 */           statement2 = group.getSqls().subList(group.getSqls().size() / 2 + group.getSqls().size() % 2, group.getSqls().size());
        }
        
/* 115 */         int start = overView.getLastRowNum() + 1;
/* 116 */         for (int i = 0; i < statement1.size(); i++) {
/* 117 */           int lastnm = overView.getLastRowNum() + 1;
/* 118 */           HSSFRow row = overView.createRow(lastnm);
/* 119 */           HSSFCell catagory = row.createCell(0);
/* 120 */           if (i == 0) {
/* 121 */             catagory.setCellValue(group.getLongname() + "(" + group.getId() + ")");
          }
/* 123 */           catagory.setCellStyle(cata);
          
/* 125 */           HSSFCell cellName1 = row.createCell(1);
/* 126 */           cellName1.setCellValue(((Statement)statement1.get(i)).getLongname());
/* 127 */           cellName1.setCellStyle(style);
          
/* 129 */           HSSFCell cellLname2 = row.createCell(2);
/* 130 */           cellLname2.setCellValue(((Statement)statement1.get(i)).getId());
/* 131 */           cellLname2.setCellStyle(style2);
          
/* 133 */           HSSFCell cellName3 = row.createCell(3);
/* 134 */           cellName3.setCellStyle(style);
/* 135 */           if ((statement2 != null) && (i <= statement2.size() - 1)) {
/* 136 */             cellName3.setCellValue(((Statement)statement2.get(i)).getLongname());
          }
/* 138 */           HSSFCell cellLname4 = row.createCell(4);
/* 139 */           cellLname4.setCellStyle(style2);
/* 140 */           if ((statement2 != null) && (i <= statement2.size() - 1)) {
/* 141 */             cellLname4.setCellValue(((Statement)statement2.get(i)).getId());
          }
        }
/* 144 */         int end = overView.getLastRowNum();
/* 145 */        // overView.addMergedRegion(new CellRangeAddress(start, end, 0, 0));
      } }
/* 147 */     overView.autoSizeColumn(0);
/* 148 */     overView.autoSizeColumn(1);
/* 149 */     overView.autoSizeColumn(2);
/* 150 */     overView.autoSizeColumn(3);
/* 151 */     overView.autoSizeColumn(4);
    

/* 154 */     createSqlDetail(book, models);
/* 155 */     createLink(book, overView);
    
/* 157 */     writeFile(fileName.getAbsolutePath(), book);
    
/* 159 */     return book;
  }
  
  private void createLink(HSSFWorkbook book, HSSFSheet overView) {
/* 163 */     int rows = overView.getLastRowNum();
/* 164 */     String sheetName = null;
/* 165 */     for (int j = 0; j <= rows; j++) {
/* 166 */       HSSFRow row = overView.getRow(j);
/* 167 */       if (row != null) {
/* 168 */         HSSFCell cell = row.getCell(0);
/* 169 */         if ((cell != null) && (cell.getStringCellValue() != null) && (cell.getStringCellValue().trim().length() > 0) && 
/* 170 */           (cell.getStringCellValue().trim().indexOf("(") != -1)) {
/* 171 */           sheetName = cell.getStringCellValue().trim().substring(0, cell.getStringCellValue().trim().indexOf("(")).trim();
        }
        
/* 174 */         if (sheetName != null) {
/* 175 */           HSSFSheet desctSheet = book.getSheet(sheetName);
/* 176 */           if (desctSheet != null) {
/* 177 */             HSSFCell cell2 = row.getCell(2);
/* 178 */           //  if (cell2 != null)
/* 179 */              // createLink(cell2, cell2.getStringCellValue(), desctSheet, 3);
/* 180 */            // HSSFCell cell4 = row.getCell(4);
/* 181 */           //  if (cell4 != null) {
/* 182 */              // createLink(cell4, cell4.getStringCellValue(), desctSheet, 3);
//            }
          }
        }
      }
    }
  }
  
  private void createSqlDetail(HSSFWorkbook book, List<SqlGroup> models)
  {
/* 192 */     for (SqlGroup sqlGroup : models) {
/* 193 */       if (book.getSheet(sqlGroup.getLongname()) == null)
      {
/* 195 */         HSSFSheet sheet = book.createSheet(sqlGroup.getLongname());
System.out.println(sqlGroup.getLongname()+sqlGroup.getPackage()+ "   " +sqlGroup.getId());
                  if(sqlGroup.getSqls()==null)
                	  continue;
/* 196 */         List<HSSFCellModel[]> contents = new ArrayList();
/* 197 */         for (Statement st : sqlGroup.getSqls()) {
/* 198 */           contents.add(new HSSFCellModel[] { new HSSFCellModel("中文名称：", Short.valueOf(this.ALIGN_LEFT), Short.valueOf(this.FILLPATTERN), Short.valueOf(this.FGC_BLUE_GREY)), new HSSFCellModel(st.getLongname(), Short.valueOf(this.ALIGN_LEFT), Short.valueOf(this.FILLPATTERN), Short.valueOf(this.FGC_BLUE_GREY)), new HSSFCellModel("命名SQLID：", Short.valueOf(this.ALIGN_LEFT), Short.valueOf(this.FILLPATTERN), Short.valueOf(this.FGC_BLUE_GREY)), new HSSFCellModel(st.getId(), Short.valueOf(this.ALIGN_LEFT), Short.valueOf(this.FILLPATTERN), Short.valueOf(this.FGC_BLUE_GREY)), new HSSFCellModel("NULL", Short.valueOf(this.ALIGN_LEFT), Short.valueOf(this.FILLPATTERN), Short.valueOf(this.FGC_BLUE_GREY)), new HSSFCellModel("NULL", Short.valueOf(this.ALIGN_LEFT), Short.valueOf(this.FILLPATTERN), Short.valueOf(this.FGC_BLUE_GREY)) });
          




/* 204 */           HSSFCellModel model1 = new HSSFCellModel("NULL", Short.valueOf(this.ALIGN_LEFT), Short.valueOf(this.FILLPATTERN), Short.valueOf(this.FGC_GREY_25));
/* 205 */           HSSFCellModel model2 = new HSSFCellModel("NULL", Short.valueOf(this.ALIGN_LEFT), Short.valueOf(this.FILLPATTERN), Short.valueOf(this.FGC_GREY_25));
/* 206 */           HSSFCellModel model3 = new HSSFCellModel("NULL", Short.valueOf(this.ALIGN_LEFT), Short.valueOf(this.FILLPATTERN), Short.valueOf(this.FGC_GREY_25));
/* 207 */           HSSFCellModel model4 = new HSSFCellModel("NULL", Short.valueOf(this.ALIGN_LEFT), Short.valueOf(this.FILLPATTERN), Short.valueOf(this.FGC_GREY_25));
/* 208 */           if (Select.class.isAssignableFrom(st.getClass())) {
/* 209 */             Select select = (Select)st;
/* 210 */             model1 = new HSSFCellModel("缓存类型：", Short.valueOf(this.ALIGN_LEFT), Short.valueOf(this.FILLPATTERN), Short.valueOf(this.FGC_GREY_25));
/* 211 */             model2 = new HSSFCellModel(select.getCache().name(), Short.valueOf(this.ALIGN_LEFT), Short.valueOf(this.FILLPATTERN), Short.valueOf(this.FGC_GREY_25));
          }
/* 213 */           if ((!(st instanceof Insert)) && (!(st instanceof cn.com.zte.ngbc.frw.model.sql.Ddl))) {
/* 214 */             model3 = new HSSFCellModel("方法：", Short.valueOf(this.ALIGN_LEFT), Short.valueOf(this.FILLPATTERN), Short.valueOf(this.FGC_GREY_25));
/* 215 */             String s = getMethods(st);
/* 216 */             model4 = new HSSFCellModel(s, Short.valueOf(this.ALIGN_LEFT), Short.valueOf(this.FILLPATTERN), Short.valueOf(this.FGC_GREY_25));
          }
          
/* 219 */           contents.add(new HSSFCellModel[] { new HSSFCellModel("Sql超时时间：", Short.valueOf(this.ALIGN_LEFT), Short.valueOf(this.FILLPATTERN), Short.valueOf(this.FGC_GREY_25)), new HSSFCellModel("chaoshi" + "", Short.valueOf(this.ALIGN_RIGHT), Short.valueOf(this.FILLPATTERN), Short.valueOf(this.FGC_GREY_25)), model1, model2, model3, model4 });
          



/* 224 */           List sqls = null;
/* 225 */           if ((st instanceof DynamicSelect)) {
/* 226 */             DynamicSelect ds = (DynamicSelect)st;
/* 227 */             sqls = ds.getDynamicSqls();
          } else {
/* 229 */             sqls = st.getSqls(); }
/* 230 */           HSSFCellModel model5 = new HSSFCellModel("NULL", Short.valueOf(this.ALIGN_LEFT), Short.valueOf(this.FILLPATTERN), Short.valueOf(this.FGC_GREY_25));
/* 231 */           HSSFCellModel model6 = new HSSFCellModel("NULL", Short.valueOf(this.ALIGN_LEFT), Short.valueOf(this.FILLPATTERN), Short.valueOf(this.FGC_GREY_25));
/* 232 */           HSSFCellModel model7 = new HSSFCellModel("NULL", Short.valueOf(this.ALIGN_LEFT), Short.valueOf(this.FILLPATTERN), Short.valueOf(this.FGC_GREY_25));
/* 233 */           HSSFCellModel model8 = new HSSFCellModel("NULL", Short.valueOf(this.ALIGN_LEFT), Short.valueOf(this.FILLPATTERN), Short.valueOf(this.FGC_GREY_25));
/* 234 */           HSSFCellModel model9 = new HSSFCellModel("NULL", Short.valueOf(this.ALIGN_LEFT), Short.valueOf(this.FILLPATTERN), Short.valueOf(this.FGC_GREY_25));
/* 235 */           HSSFCellModel model10 = new HSSFCellModel("NULL", Short.valueOf(this.ALIGN_LEFT), Short.valueOf(this.FILLPATTERN), Short.valueOf(this.FGC_GREY_25));
/* 236 */           for (Object sql : sqls) {
/* 237 */             model5 = new HSSFCellModel("数据库类型：", Short.valueOf(this.ALIGN_LEFT), Short.valueOf(this.FILLPATTERN), Short.valueOf(this.FGC_GREY_25));
/* 238 */             if ((sql instanceof DynamicSqlSqlNode)) {
/* 239 */               DynamicSqlSqlNode dssn = (DynamicSqlSqlNode)sql;
/* 240 */               model6 = new HSSFCellModel(dssn.getType().name(), Short.valueOf(this.ALIGN_LEFT), Short.valueOf(this.FILLPATTERN), Short.valueOf(this.FGC_GREY_25));
                         System.out.println("数据库类型："+dssn.getType().name());

} else {
/* 242 */               Sql s = (Sql)sql;
/* 243 */               model6 = new HSSFCellModel(s.getType()==null?"":s.getType().name(), Short.valueOf(this.ALIGN_LEFT), Short.valueOf(this.FILLPATTERN), Short.valueOf(this.FGC_GREY_25));
System.out.println("数据库类型："+s.getType()==null?"":s.getType().name());
            
            }
            
/* 246 */             model7 = new HSSFCellModel("sql：", Short.valueOf(this.ALIGN_LEFT), Short.valueOf(this.FILLPATTERN), Short.valueOf(this.FGC_GREY_25));
/* 247 */             if ((sql instanceof DynamicSqlSqlNode)) {
/* 248 */               DynamicSqlSqlNode dssn = (DynamicSqlSqlNode)sql;
/* 249 */               String content = dynamicSqlParse(dssn, null);
/* 250 */               model8 = new HSSFCellModel(content, Short.valueOf(this.ALIGN_LEFT), null, null);
            } else {
/* 252 */               Sql s = (Sql)sql;
/* 253 */               model8 = new HSSFCellModel(s.getSql(), Short.valueOf(this.ALIGN_LEFT), null, null);
            }
/* 255 */             contents.add(new HSSFCellModel[] { model5, model6, model7, model8, model9, model10 });
/* 256 */             createRow(contents, sheet);
/* 257 */             //sheet.addMergedRegion(new CellRangeAddress(contents.size() - 1, contents.size() - 1, 3, 5));
          }
/* 259 */           contents.clear();
          
/* 261 */           contents.add(new HSSFCellModel[] { new HSSFCellModel("参数类型:", Short.valueOf(this.ALIGN_LEFT), Short.valueOf(this.FILLPATTERN), Short.valueOf(this.FGC_GREY_25)), new HSSFCellModel(st.getParameterMap().getClazz(), Short.valueOf(this.ALIGN_LEFT), Short.valueOf(this.FILLPATTERN), Short.valueOf(this.FGC_GREY_25)), new HSSFCellModel("NULL", Short.valueOf(this.ALIGN_LEFT), Short.valueOf(this.FILLPATTERN), Short.valueOf(this.FGC_GREY_25)), new HSSFCellModel("NULL", Short.valueOf(this.ALIGN_LEFT), Short.valueOf(this.FILLPATTERN), Short.valueOf(this.FGC_GREY_25)), new HSSFCellModel("NULL", Short.valueOf(this.ALIGN_LEFT), Short.valueOf(this.FILLPATTERN), Short.valueOf(this.FGC_GREY_25)), new HSSFCellModel("NULL", Short.valueOf(this.ALIGN_LEFT), Short.valueOf(this.FILLPATTERN), Short.valueOf(this.FGC_GREY_25)) });
          





/* 268 */           contents.add(new HSSFCellModel[] { new HSSFCellModel("字段名", Short.valueOf(this.ALIGN_LEFT), Short.valueOf(this.FILLPATTERN), Short.valueOf(this.FGC_GREY_25)), new HSSFCellModel("Java类型", Short.valueOf(this.ALIGN_LEFT), Short.valueOf(this.FILLPATTERN), Short.valueOf(this.FGC_GREY_25)), new HSSFCellModel("中文名", Short.valueOf(this.ALIGN_LEFT), Short.valueOf(this.FILLPATTERN), Short.valueOf(this.FGC_GREY_25)), new HSSFCellModel("字典ID", Short.valueOf(this.ALIGN_LEFT), Short.valueOf(this.FILLPATTERN), Short.valueOf(this.FGC_GREY_25)), new HSSFCellModel("模式", Short.valueOf(this.ALIGN_LEFT), Short.valueOf(this.FILLPATTERN), Short.valueOf(this.FGC_GREY_25)), new HSSFCellModel("数据库类型", Short.valueOf(this.ALIGN_LEFT), Short.valueOf(this.FILLPATTERN), Short.valueOf(this.FGC_GREY_25)) });
          





/* 275 */           List<Parameter> paras = st.getParameterMap().getParameters();
/* 276 */           if (paras != null) {
/* 277 */             for (Parameter p : paras) {
/* 278 */               contents.add(new HSSFCellModel[] { new HSSFCellModel(p.getId(), Short.valueOf(this.ALIGN_LEFT), null, null), new HSSFCellModel(p.getJavaType(), Short.valueOf(this.ALIGN_LEFT), null, null), new HSSFCellModel(p.getLongname(), Short.valueOf(this.ALIGN_LEFT), null, null), new HSSFCellModel(p.getRef(), Short.valueOf(this.ALIGN_LEFT), null, null), new HSSFCellModel(p.getMode().name(), Short.valueOf(this.ALIGN_LEFT), null, null), new HSSFCellModel(p.getJdbcType().name(), Short.valueOf(this.ALIGN_LEFT), null, null) });
            }
          }
          



/* 285 */           if (Select.class.isAssignableFrom(st.getClass())) {
/* 286 */             Select select = (Select)st;
/* 287 */             contents.add(new HSSFCellModel[] { new HSSFCellModel("返回结果:", Short.valueOf(this.ALIGN_LEFT), Short.valueOf(this.FILLPATTERN), Short.valueOf(this.FGC_GREY_25)), new HSSFCellModel("类型", Short.valueOf(this.ALIGN_LEFT), Short.valueOf(this.FILLPATTERN), Short.valueOf(this.FGC_GREY_25)), new HSSFCellModel(select.getResultMap().getClazz(), Short.valueOf(this.ALIGN_LEFT), null, null), new HSSFCellModel("NULL", Short.valueOf(this.ALIGN_LEFT), null, null), new HSSFCellModel("NULL", Short.valueOf(this.ALIGN_LEFT), null, null), new HSSFCellModel("NULL", Short.valueOf(this.ALIGN_LEFT), null, null) });
            






/* 295 */             contents.add(new HSSFCellModel[] { new HSSFCellModel("Java属性名", Short.valueOf(this.ALIGN_LEFT), Short.valueOf(this.FILLPATTERN), Short.valueOf(this.FGC_GREY_25)), new HSSFCellModel("数据库字段名", Short.valueOf(this.ALIGN_LEFT), Short.valueOf(this.FILLPATTERN), Short.valueOf(this.FGC_GREY_25)), new HSSFCellModel("Java类型", Short.valueOf(this.ALIGN_LEFT), Short.valueOf(this.FILLPATTERN), Short.valueOf(this.FGC_GREY_25)), new HSSFCellModel("数据库类型", Short.valueOf(this.ALIGN_LEFT), Short.valueOf(this.FILLPATTERN), Short.valueOf(this.FGC_GREY_25)), new HSSFCellModel("中文名", Short.valueOf(this.ALIGN_LEFT), Short.valueOf(this.FILLPATTERN), Short.valueOf(this.FGC_GREY_25)), new HSSFCellModel("NULL", Short.valueOf(this.ALIGN_LEFT), Short.valueOf(this.FILLPATTERN), Short.valueOf(this.FGC_GREY_25)) });
            






/* 303 */             if (select.getResultMap().getResults() != null) {
/* 304 */               for (Result result : select.getResultMap().getResults()) {
/* 305 */                // contents.add(new HSSFCellModel[] { new HSSFCellModel(result.getId(), Short.valueOf(this.ALIGN_LEFT), null, null), new HSSFCellModel(result.getColumn(), Short.valueOf(this.ALIGN_LEFT), null, null), new HSSFCellModel(result.getJavaType(), Short.valueOf(this.ALIGN_LEFT), null, null), new HSSFCellModel(result.getJdbcType().name(), Short.valueOf(this.ALIGN_LEFT), null, null), new HSSFCellModel(result.getLongname(), Short.valueOf(this.ALIGN_LEFT), null, null), new HSSFCellModel("NULL", Short.valueOf(this.ALIGN_LEFT), null, null) });
              }
            }
          }
          





/* 315 */           contents.add(new HSSFCellModel[0]);
/* 316 */           createRow(contents, sheet);
        }
/* 318 */         for (int i = 0; i < 6; i++)
/* 319 */           sheet.autoSizeColumn(i);
      }
    }
  }
  
  private String getMethods(Statement st) {
/* 325 */     String s = "";
/* 326 */     if ((st instanceof Select)) {
/* 327 */       Select select = (Select)st;
/* 328 */       Select.Method[] ms = select.getMethod();
/* 329 */       for (Select.Method method : ms) {
/* 330 */         s = s + method.getId() + " ";
      }
    }
/* 333 */     if ((st instanceof Delete)) {
/* 334 */       Delete de = (Delete)st;
/* 335 */       Delete.Method m = de.getMethod();
/* 336 */       return m.name();
    }
/* 338 */     if ((st instanceof Procedure)) {
/* 339 */       Procedure p = (Procedure)st;
/* 340 */       Procedure.Method m = p.getMethod();
/* 341 */       return m.name();
    }
/* 343 */     if ((st instanceof Update)) {
/* 344 */       Update p = (Update)st;
/* 345 */       Update.Method m = p.getMethod();
/* 346 */       return m.name();
    }
/* 348 */     return s;
  }
  
  private String dynamicSqlParse(DynamicSqlSqlNode node, StringBuffer sb) {
/* 352 */     ByteArrayOutputStream out = new ByteArrayOutputStream();
/* 353 */     ModelFactoryUtil.xcm.save(node, out);
//              StringBuilder sqlBuilder = new StringBuilder();
//           List<SqlNode> logics = node.getLogicSqlNodes();
//           for (SqlNode logic : logics)
//           {}

SqlNodeHandler sqlProcessor = new DynamicSqlSqlNodeHandler(node);

//String sql = sqlProcessor.process(new DynamicContext());
//
//System.out.println(sql);


    try {
/* 355 */       return out.toString("UTF-8");
    }
    catch (UnsupportedEncodingException e) {
/* 358 */       e.printStackTrace();
    }
/* 360 */     return null;
  
	}
  
}

/* Location:              /home/dhlsoft/tool/zte-api-1.0.jar!/cn/com/zte/ant/task/doc/nj/excel/tools/NsqlExcelProcessor.class
 * Java compiler version: 6 (50.0)
 * JD-Core Version:       0.7.1
 */